  <script>
function confirmDialog() {
    return confirm("ต้องการลบข้อมูลผู้ใช้งานที่เลือก ?")
}

</script>  
  <div id="page-wrapper">
            <div class="row">
            <img src="<?php echo base_url() ?>bootstrap/tot/bnnr-eservice1.jpg" class="img-responsive" alt="Responsive image">
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
            <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-primary">
                        <div class="panel-heading">
                            ข้อมูล PON FTTx By TOT
                        </div>
                        <div class="panel panel-default">
                        <!-- /.panel-heading -->
                        <div class="panel-body">

                        <div class="col-md-3 col-md-offset-4">
                            <a class="btn btn-block btn-social btn-twitter" a href="<? echo base_url()?>index.php/admin/user/add">
                                <i class="fa fa-twitter"></i> เพิ่มผู้ดูแลระบบ
                            </a>         
                            <hr>             
                        </div>
            
                  

                            <div class="table-responsive">
                                <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                                    <thead>
                                        <tr>
                                            <th>ลำดับ</th>
                                            <th>Username</th>
                                            <th>ชื่อ-สกุล</th>
                                            <th>ตำแหน่ง</th>
                                            <th>ดำเนินการ</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <?php
                                        $no=1;
                                        foreach($query as $rs){
                                            echo "<tr>";
                                            echo "<td>".$no."</td>";
                                            echo "<td>".$rs->admin_username."</td>";
                                            echo "<td>".$rs->admin_fname."</td>";
                                            echo "<td>".$rs->admin_position."</td>";

                                            echo "<td>"; 

                                            echo "<a href=".base_url()."index.php/admin/user/update/".$rs->admin_id." class='btn btn-primary btn-xs'> 
                                                <span class='glyphicon glyphicon-pencil'></span> แก้ไขข้อมูลผู้ดูแลระบบ
                                                </a> ";
                                            echo "<a href=".base_url()."index.php/admin/user/del/".$rs->admin_id." type='button' class='btn btn-danger btn-xs' onClick='return confirmDialog();'> 
                                                <span class='glyphicon glyphicon-floppy-remove'></span> ลบผู้ดูแลระบบ
                                            </a>";
   
                                            echo '</td>';
                                            echo '</tr>';
                                            $no++;
                                        }
                                    ?>
                                    </tbody>
                                </table>
                            </div>
                            <!-- /.table-responsive -->
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>
                <!-- /.col-lg-6 -->
            </div>
            <!-- /.row -->
        </div>
        <!-- /#page-wrapper -->

